package com.nai365.nart.member.feign;

import com.nai365.nart.common.core.constant.SecurityConstants;
import com.nai365.nart.common.core.constant.ServiceNameConstants;
import com.nai365.nart.common.core.util.R;
import com.nai365.nart.member.dto.ChainVerifyUserDto;
import com.nai365.nart.member.dto.RecoveryDto;
import com.nai365.nart.member.dto.SimpleMemberDto;
import com.nai365.nart.member.entity.Member;
import com.nai365.nart.member.entity.WalletChange;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Collection;
import java.util.List;

@FeignClient(contextId = "RemoteMemberService", value = ServiceNameConstants.MEMBER_SERVICE)
public interface RemoteMemberService {
	/**
	 * 根据手机号查询会员
	 *
	 * @param phone
	 * @return
	 */
	@GetMapping("/member/findMemberByPhone/{phone}")
	public Member findMemberByPhone(@PathVariable("phone") String phone, @RequestHeader(SecurityConstants.FROM) String from);


	@PostMapping("/member/updateMemberIsVerify")
	public R updateMemberIsVerify(@RequestBody ChainVerifyUserDto chainVerifyUserDto, @RequestHeader(SecurityConstants.FROM) String from);


	/**
	 * 根据id列表查询会员信息
	 *
	 * @param idList id列表
	 * @return R<List < SimpleMemberDto>>
	 */
	@GetMapping("/member/list/ids")
	R<List<SimpleMemberDto>> listByIds(@RequestParam(value = "idList") Collection<Long> idList);
	/**
	 * 根据id列表查询会员头像和昵称
	 *
	 * @param ids id列表
	 * @return
	 */
	@PostMapping("/member/findHeaderAndNickname")
	R findHeaderAndNickname(@RequestBody List<Long> ids, @RequestHeader(SecurityConstants.FROM) String from);

	/**
	 * 根据id查询会员信息
	 *
	 * @param id 用户/会员 id
	 * @return R<Member>
	 */
	@GetMapping("/member/{id}")
	R<Member> getById(@PathVariable("id") Long id);


	@GetMapping("/member/findCoinAdress/{merberId}")
	public Member findCoinAdress(@PathVariable("merberId") Long merberId,@RequestHeader(SecurityConstants.FROM) String from);

	@GetMapping("/member/findUserPayPassByUserId/{userId}")
	public Member findUserPayPassByUserId(@PathVariable("userId") Long userId,@RequestHeader(SecurityConstants.FROM) String from);

	@PostMapping("/member/recoveryGoods")
	public R<WalletChange> recoveryGoods(@RequestBody RecoveryDto recoveryDto,@RequestHeader(SecurityConstants.FROM) String from);
}
